<%@ page import="com.idriver.service.StudentService" %>
<%@ page import="com.idriver.bean.Student" %><%--
  Created by IntelliJ IDEA.
  User: wulimin
  Date: 2021/12/14
  Time: 7:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>编辑学员信息</title>
</head>
<body>
<%
    StudentService service = new StudentService();
    String id = request.getParameter("id");
    Student student = service.findStudentById(Integer.parseInt(id));
%>
<form action="editStudent" method="post">
    <p>姓名: <input type="text" name="name" value="<%= student.getName() %>"></p>
    <p>
        性别:
        <%
            if ("男".equals(student.getSex())) {
        %>
        男 <input type="radio" name="sex" value="男" checked="checked" />
        女 <input type="radio" name="sex" value="女" />
        <%
            } else {
        %>
        男 <input type="radio" name="sex" value="男" />
        女 <input type="radio" name="sex" value="女" checked="checked"  />
        <%
            }
        %>
    </p>
    <p>出生日期: <input type="text" name="birthday" value="<%= student.getBirthday() %>"></p>
    <p>邮箱: <input type="text" name="mail" value="<%= student.getMail() %>"></p>
    <p>备注: <textarea name="mark"><%= student.getMark() %></textarea></p>
    <p><input type="submit" value="修改"></p>
</form>
</body>
</html>
